package com.pivotal.cloud.crypto.keygen;

/**
 * @className: com.pivotal.cloud.security.crypto.keygen.SharedKeyGenerator
 * @projectName: PivotalCloud项目
 * @module: PivotalCloud项目-SharedKeyGenerator类，主要位于Security安全模块-共享Key生成器模块
 * @content: SharedKeyGenerator-共享Key生成器
 * @author: Powered by Marklin
 * @datetime: 2025-06-24 15:11
 * @version: 1.0.0
 * @copyright: Copyright © 2018-2025 PivotalCloud Systems Incorporated. All rights
 * reserved.
 */
public class SharedKeyGenerator implements BytesKeyGenerator {

	private byte[] sharedKey;

	SharedKeyGenerator(byte[] sharedKey) {
		this.sharedKey = sharedKey;
	}

	/**
	 * 获取Key长度
	 * @return 返回值
	 */
	@Override
	public int getKeyLength() {
		return this.sharedKey.length;
	}

	/**
	 * 生成Key
	 * @return 返回值
	 */
	@Override
	public byte[] generateKey() {
		return this.sharedKey;
	}

}
